package io.renren.modules.app.indexController;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.app.entity.index.YcEduBgdEntity;
import io.renren.modules.app.service.index.YcEduBgdService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * 
 *
 * @author lym
 * @email 928185446qq.com
 * @date 2023-12-26 21:07:55
 */
@RestController
@RequestMapping("app/ycedubgd")
public class YcEduBgdController {
    @Autowired
    private YcEduBgdService ycEduBgdService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("app:ycedubgd:list")
    public R list(@RequestParam Map<String, Object> params){
       PageUtils page = ycEduBgdService.queryPage(params);

        return R.ok().put("page", page);

    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("app:ycedubgd:info")
    public R info(@PathVariable("id") Integer id){
		YcEduBgdEntity ycEduBgd = ycEduBgdService.getById(id);

        return R.ok().put("ycEduBgd", ycEduBgd);

    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("app:ycedubgd:save")
    public R save(@RequestBody YcEduBgdEntity ycEduBgd){
		ycEduBgdService.save(ycEduBgd);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("app:ycedubgd:update")
    public R update(@RequestBody YcEduBgdEntity ycEduBgd){
		ycEduBgdService.updateById(ycEduBgd);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("app:ycedubgd:delete")
    public R delete(@RequestBody Integer[] ids){
		ycEduBgdService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
